#pragma once


/*
 * System definitions and utilities for interfacing with the system APIs
 */


#include <exception>
#include <system_error>

#if defined(_WIN32) || defined(WIN32)
#define WINDOWS
#elif defined(__linux__)
#define LINUX
#else
#error Unsupported operating system
#endif

#if defined(__clang__)
#define COMPILER_CLANG
#elif defined(__GNUC__)
#define COMPILER_GCC
#elif defined(_MSC_VER)
#define COMPILER_MSVC
#else
#error Unsupported compiler
#endif


namespace bzbutil {


	constexpr unsigned int BZB_VERSION_MAJOR = 0;
	constexpr unsigned int BZB_VERSION_MINOR = 7;
	constexpr unsigned int BZB_VERSION_PATCH = 1;


	/*
	 * Throws a system_error with error code retrieved from GetLastError() or errno
	 */

	void throw_sys_error();


	/*
	 * Throws a system_error with the given error code
	 */

	void throw_sys_error(int err);


}
